package com.okilo.online.app.lib.device.util

import android.content.Context
import android.os.Build
import com.okilo.online.app.lib.device.util.OkiloDevUtils.takeZipString
import org.json.JSONObject
import java.lang.Exception

/**
 * hardware
 */
class OkiloDev3(val context: Context) {

    fun gOkiloDev3Data(): String? {
        return try {
           val data = JSONObject().apply {
                put("operatingSystem", "ANDROID")
                put("model", Build.MODEL.toString())
                put("serial", "")
                put("productionDate", Build.TIME.toString())
                put("sdkVersion", Build.VERSION.SDK_INT.toString())
                put("phoneType", OkiloDevUtils.gDev3Params2(context))
                put("versionCode", OkiloDevUtils.gDev3Params11(context))
                put("versionName", OkiloDevUtils.gDev3Params10(context))
                put("androidId", OkiloDevUtils.gDev3Params1(context))
                put("telephony", OkiloDevUtils.gDev1AndDev3Params3(context))
                put("isVpn", OkiloDevUtils.gDev3Params19(context))
                put("isProxyPort", OkiloDevUtils.gDev3Params20())
                put("isDebug", OkiloDevUtils.gDev3Params7(context))
                put("simState", OkiloDevUtils.gDev3Params12(context))
                put("root", OkiloDevUtils.gDev3Params14())
                put("physicalSize", OkiloDevUtils.gDev3Params18(context))
                put("displayLanguage", OkiloDevUtils.gDev3Params3())
                put("iso3Language", OkiloDevUtils.gDev3Params4())
                put("iso3Country", OkiloDevUtils.gDev3Params5())
                put("networkOperatorName", OkiloDevUtils.gDev1AndDev3Params3(context))
                put("networkType", OkiloDevUtils.gDev1AndDev3Params2(context))
                put("timeZoneId", OkiloDevUtils.gDev3Params6())
                put("elapsedRealtime", OkiloDevUtils.gDev3Params8())
                put("sensorList", OkiloDevUtils.gDev3Params13(context))
                put("lastBootTime", OkiloDevUtils.gDev3Params9())
                put("rootJailbreak", OkiloDevUtils.gDev3Params14())
                put("keyboard", OkiloDevUtils.gDev3Params15(context))
                put("isSimulator", OkiloDevUtils.gDev3Params16())
                put("dbm", OkiloDevUtils.gDev3Params17(context)) //
                put("phoneNumber", "")
            }
            data.toString().takeZipString()
        } catch (e: Exception) {
            null
        }
    }
}